Skip to content

Allow corrected table creation after a Perspective failure - #208

Closed
pengpengyi92 wants to merge 1 commit into
Point72:mainfrom
pengpengyi92:codex/fix-table-creation-retry-20261114
Closed

pengpengyi92 wants to merge 1 commit into
Point72:mainfrom
pengpengyi92:codex/fix-table-creation-retry-20261114

Conversation

@pengpengyi92

Copy link
Copy Markdown

Description

Register a table in TableHost only after Perspective successfully creates it.

Currently new_table() writes _schemas and _temporal_columns before
calling the Perspective client. If that call raises (for example an invalid
column type), names() still advertises the failed table. A corrected retry
returns False because the name is cached, and update() then raises
KeyError because there is no backend table. A mixed schema batch can also
publish a dashboard tab for the table that failed to exist.

Create the real table first, then register its metadata and handle together.
The original Perspective error still propagates; no failed operation is
silently accepted. Existing-table idempotency, limits and the established
partial-batch behavior remain unchanged. No version/dependency/API changes.

Three regression tests use the actual native Perspective client, not a
mock: failed creation leaves no metadata, corrected retry accepts data, and
a failed table does not become a phantom tab alongside an earlier valid table.

Type of Change

  • Bug fix

Validation

Base: d7a553243c2a3a654e3119140df773d1f4695791. Windows 11 / Python 3.12.14,
Perspective 5.6.1, Ray 2.60.0, spaday 0.14.1, transports 0.12.3.

python -m pytest raydar/tests/test_table_creation.py -q -o addopts=
python -m pytest raydar/tests/test_table_creation.py \
  raydar/tests/test_dashboard.py raydar/tests/test_ops.py \
  raydar/tests/test_schema.py \
  -k 'not TestDashboardApp and not TestLocalDashboard' -q -o addopts=
python -m ruff check raydar
python -m ruff format --check raydar
  • New regressions on a clean detached base: 3 failed. Candidate: 3 passed.
    The imported checkout was verified in each clean-base/candidate control.
  • Existing core selection on the clean base: 37 passed; candidate with
    the three regressions: 40 passed, 7 existing server/app cases deselected.
  • Ruff check and format check pass across the package (20 files).
  • Broader selection excluding only TestDashboardApp: base 38 passed,
    2 failed
    ; candidate 41 passed, 2 failed, the same failure IDs:
    test_poll_loop_survives_a_bad_batch and
    test_stop_is_idempotent_and_releases_the_port. In this Windows environment
    the local server thread does not stop and port reuse raises WinError 10048.
    These were observed before production edits and are not fixed in this PR.
  • The initial combined dashboard/ops/schema run including app tests hit a
    150-second timeout on the base; no completed test count or pass is claimed
    for that run. Full Ray actor/Serve integration and make test are not
    validated locally. Upstream CI is separate evidence.

Checklist

  • Full make lint (Python Ruff checks above pass; documentation tools not run)
  • Full make test (scoped passes and inherited Windows limits above)
  • Regression tests added for the reproduced failure
  • No documentation/version bump needed for this internal ordering fix

Prepared with OpenAI Codex assistance. Tests and clean-base controls were
actually executed. The author explicitly authorized DCO sign-off for this
original contribution only. This is a new table-creation recovery fix, not a
claim that the old Ray Serve issue #57 was reproduced or resolved.

Signed-off-by: Pengyi Peng <pengpengyi92@users.noreply.github.com>

@gauglertodd gauglertodd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool, looks good to me - approving.

@timkpaine

Copy link
Copy Markdown
Member

Thanks for the PR! I've moved to #210 to consolidate and trim

@timkpaine timkpaine closed this Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants